
import 'dart:io';

import 'package:dio/dio.dart';
import '../../helper/uidata.dart';

class ImageSpaceHelper{


static Future<String> UpLoad(File f1) async {
    Dio dio = new Dio();
    var formData = new FormData.fromMap({
      "name": "wendux",
      "age": 25,
      //"file": f1,
      "file": await MultipartFile.fromFile(f1.path,filename: "1.jpg")
    });
     dio.options.headers['auth']=UIData.token;
    var response =
        await dio.post(UIData.imageUploadServer, data: formData);
    
    print(response);
    if (response.statusCode == HttpStatus.ok) {
      return response.data.toString();
    } else {
      return "";
    }
  }}